package com.pp.tourism.web.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.pp.tourism.web.pojo.ScenicRecommend;
import com.pp.tourism.web.pojo.ScenicSpot;
import com.pp.tourism.web.pojo.ScenicSpot1;
import com.pp.tourism.web.pojo.UserCommentTop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 景点信息表 Mapper 接口
 * </p>
 *
 * @author wjm
 * @since 2019-03-20
 */
@Mapper
public interface ScenicSpotMapper extends BaseMapper<ScenicSpot> {

    @Select("select * from tw_scenic_spot ORDER BY update_time desc")
    List<ScenicSpot1> queryAll();

    @Select("select scenic_id from tw_scenic_recommend GROUP BY scenic_id ORDER BY COUNT(scenic_id) DESC")
    List<ScenicRecommend> queryHitSpot();

    @Select("select scenic_id,count(scenic_id) as comment from tw_user_comment_top GROUP BY scenic_id ORDER BY count(scenic_id)")
    List<UserCommentTop> queryMaxView();
}
